Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added some basic CLI #49

Closed
wants to merge 4 commits into from
Closed

Added some basic CLI #49

wants to merge 4 commits into from

Conversation

lsv
Copy link

@lsv lsv commented Apr 3, 2012

Command line interface (CLI)

You will need to edit a Doctrine file for this to work.
Goto
Doctrine/ORM/Tools/Console/ConsoleRunner.php

Add this

// Fixtures
new \Doctrine\Common\DataFixtures\Command\Add(),

after

new \Doctrine\ORM\Tools\Console\Command\InfoCommand(),

Now you can use

./doctrine fixtures:add

Options to fixtures:add

--directory (-d) Directory with your fixtures - Its relative to your Entities\Proxies path *REQUIRED*
--append (-a) If you want to append your fixtures instead
--dump-fixtures Vieweing the fixtures instead of importing them

* Date: 4/3/12
* Time: 4:38 PM
* To change this template use File | Settings | File Templates.
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove this and add the license header instead

protected function configure()
{
$this
->setName('fixtures:add')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be consistent with the naming used in the symfony2 bundle, it should be load, not add.

@stof
Copy link
Member

stof commented Aug 7, 2012

Thus, I think the command should provide some protected method able to be overwritten to modify it. currently, you have to duplicate it entirely if you want to provide a command for MongoDB or PHPCR, and the DoctrineFixturesBundle cannot use it either to avoid duplicating the logic.

@jmikola
Copy link
Member

jmikola commented Aug 7, 2012

I believe all the bundles currently have commands, correct? Is this modeled after the ORM bundle's command? The structure certainly differs from LoadDataFixturesDoctrineODMCommand.

@stof
Copy link
Member

stof commented Aug 7, 2012

@jmikola yeah, currently, they all duplicate the whole command, which is why I already thought about providing a base class in the DataFixtures library (but without time to actually do it)

@lavoiesl
Copy link
Member

Shouldn’t this command be called fixtures:load to avoid confusion?

@lavoiesl lavoiesl added this to the 1.1 milestone Mar 23, 2015
@lavoiesl lavoiesl modified the milestones: 1.2, 1.1 Mar 23, 2015
@lavoiesl lavoiesl mentioned this pull request Mar 23, 2015
Closed
@L0rD59
Copy link

L0rD59 commented Jun 17, 2015

👍

@Ocramius Ocramius removed this from the 1.2 milestone Jun 19, 2016
@Ocramius Ocramius removed this from the 1.2 milestone Jun 19, 2016
@halfpastfouram
Copy link

Has there been any progress with this, whatsoever? If not, I am more than willing to take on improving this PR until it is accepted.

@SenseException
Copy link
Member

It doesn't look like @lsv is working further on it since it was created in 2012. If it is okay would you like to take over?

@halfpastfouram
Copy link

@SenseException I'd love to! I believe this PR will be a welcome addition.

@greg0ire greg0ire closed this Jan 23, 2021
@greg0ire greg0ire deleted the branch doctrine:master January 23, 2021 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants